<?php
	// Lấy sách cần sửa và hiển thị vào FORM
	session_start();
	$khachhang = new khachhangbs();
	$khachhang->MaKH = $_SESSION['MaKH'];
	$khachhangcansua = $khachhang->LayDanhSach();
	$MaDiaBan = $khachhangcansua[0]['MaDiaBan'];
	$db = new diabanbs();
	$db->MaDiaBan = $MaDiaBan;
	$dsdb = $db->LayDanhSach();
	$TenDiaBan = $dsdb[0]['TenDiaBan'];
	$nhatky = new nhatkybs();
	$nhatky->TenSuKien = "Xem thông tin cá nhân khách hàng";
	$nhatky->MaNguoiDung = $_SESSION["MaKH"];
	date_default_timezone_set('Asia/Ho_Chi_Minh');
	$nhatky->ThoiGian = date("Y-m-d H:m:s", time());
	$nhatky->Them();
?>

<div class="form">
   	<form>
         <h2>Thông tin khách hàng</h2>
         <input type="hidden" name="MaKH" value="<?php echo $khachhangcansua[0]['MaKH'];?>"/>
         <table style="width:700px; margin-left: 100px;">
			<tr>				
           		<td style="padding-top:10px;">
           			<label for="hotenlot">Họ và tên lót:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<input readonly="readonly" tabindex="1" type="text" name="Ho" class="txt" size="54" value="<?php echo $khachhangcansua[0]['Ho']; ?>"/>    
            	</td>
            </tr>
            <tr>
           		<td style="padding-top:10px;">
           			<label for="ten">Tên:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<input readonly="readonly" tabindex="1" type="text" name="Ten" class="txt" size="54" value="<?php echo $khachhangcansua[0]['Ten']; ?>"/>    
            	</td>
            </tr>
            <tr>
           		<td style="padding-top:10px;">
           			<label for="diachi">Địa chỉ:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<input readonly="readonly" tabindex="1" type="text" name="DiaChi" class="txt" size="54" value="<?php echo $khachhangcansua[0]['DiaChi']; ?>"/>    
            	</td>
            </tr>
            <tr>
           		<td style="padding-top:10px;">
           			<label for="dienthoai">Điện thoại:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<input readonly="readonly" tabindex="1" type="text" name="DienThoai" class="txt" size="54" value="<?php echo $khachhangcansua[0]['DienThoai']; ?>"/>    
            	</td>
            </tr>
            <tr>
            	<td style="padding-top:10px;">
           			<label for="gioitinh">Giới tính:</label>
           		</td>
           		<td style="padding-top:10px;">
           			<?php $GT = $khachhangcansua[0]['GioiTinh'];?>
            		<input disabled="disabled" tabindex="1" type="radio" name="GioiTinh" value="1" <?php if($GT==1) echo "checked='checked'";?> class="txt2" size="54" onchange="this.setCustomValidity('')"/>Nam 
            		<input disabled="disabled" tabindex="1" type="radio" name="GioiTinh" value="0" <?php if($GT==0) echo "checked='checked'";?> class="txt2" size="54" onchange="this.setCustomValidity('')"/>Nữ  
            	</td>
            </tr>    
			<tr>
				<td style="padding-top:10px;">
           			<label for="ngaysinh">Ngày sinh:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<input readonly="readonly" tabindex="1" type="text" name="ngaysinh" class="txt" size="54" value="<?php echo $khachhangcansua[0]['NgaySinh']; ?>"/>    
	            </td>
			</tr>		
            <tr>
           		<td style="padding-top:10px;">
           			<label for="email">Email:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<input readonly="readonly" tabindex="1" type="text" name="Email" class="txt" size="54" value="<?php echo $khachhangcansua[0]['Email']; ?>"/>    
	            </td>
	        </tr>
           	<tr>
	           	<td style="padding-top:10px;">
           			<label for="socmnd">Số CMND:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<input readonly="readonly" tabindex="1" type="text" name="socmnd" class="txt" size="54" value="<?php echo $khachhangcansua[0]['SoCMND']; ?>"/>    
	            </td>
            </tr>
           	<tr>
	           	<td style="padding-top:10px;">
           			<label for="ngaycap">Ngày cấp:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<input readonly="readonly" tabindex="1" type="text" name="ngaycap" class="txt" size="54" value="<?php echo $khachhangcansua[0]['NgayCap']; ?>"/>    
	            </td>
            </tr>
            <tr>
	           	<td style="padding-top:10px;">
           			<label for="noicap">Nơi cấp:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<input readonly="readonly" tabindex="1" type="text" name="noicap" class="txt" size="54" value="<?php echo $khachhangcansua[0]['NoiCap']; ?>"/>    
	            </td>
            </tr>
            <tr>
           		<td style="padding-top:10px;">
           			<label for="makh">Tài khoản:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<div id="showmakh" >
            			<input readonly="readonly" value="<?php echo $khachhangcansua[0]['MaKH']; ?>" readonly="readonly" tabindex="1" type="text" name="MaKH" class="txt" size="54"/>
            		</div>    
            	</td>
            </tr>
            <tr>
            	<td style="padding-top:10px;">
           			<label for="tendb">Tên địa bàn:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<div>
            			<input readonly="readonly" value="<?php echo $TenDiaBan; ?>" readonly="readonly" tabindex="1" type="text" name="MaKH" class="txt" size="54"/>
            		</div>    
            	</td>
            </tr>
            <tr>
           		<td style="padding-top:10px;">
           			<label for="ngaydangky">Ngày đăng ký:</label>
           		</td>
           		<td style="padding-top:10px;">
            		<input readonly="readonly" tabindex="1" type="text" name="ngaydangky" class="txt" size="54" value="<?php echo $khachhangcansua[0]['NgayDangKy']; ?>"/>    
	            </td>
            </tr>
        </table>
    </form>
</div>  
